package com.muyu.danmo.xxl;

import com.muyu.danmo.service.AfterSalesService;
import com.muyu.danmo.service.OrderFunctionService;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.C;
import org.springframework.stereotype.Component;

/**
 * @author Administrator
 */
@Component
@RequiredArgsConstructor
@Slf4j
public class Task {



    private final OrderFunctionService orderFunctionService;

    private final AfterSalesService afterSalesService;


    /**
     * 待评价订单10天之后转成 订单完成
     */
    @XxlJob("orderTask")
    public void execute(){
        log.info("待评价订单10天之后转成 订单完成开始执行");
        orderFunctionService.orderStatusConversion();
    }

    /**
     * 售后订单，商家处理自动完成
     */
    @XxlJob("afterSalesDelay")
    public void afterSalesDelay(){
        log.info("售后订单，商家处理自动完成开始执行");
        afterSalesService.afterSalesDelay();
    }
}
